package frontend.pages.renamefiles;

import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;

import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JFileChooser;

public class MyApplet extends JApplet {
	public void init() {
		JButton b = new JButton("File");
		b.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				JFileChooser fc = new JFileChooser();
				fc.setCurrentDirectory(new File("C:\\"));
				int returnVal = fc.showSaveDialog(MyApplet.this);
				String fileName = "C:\\image.jpeg";
				if (returnVal == JFileChooser.APPROVE_OPTION) {
					File aFile = fc.getSelectedFile();
					fileName = aFile.getName();
				}
				System.out.println(fileName);
			}
		});
		getContentPane().add(b);
	}
}
